<%@ page contentType="text/html; charset=utf-8" %>
<%@ include file="/WEB-INF/jsp/includeTaglib.jsp" %>
						<table width="100%" border="0" cellpadding="0" cellspacing="0">

						  <tr>
						     <td>
						       <table class="dbborder" width="100%" border="0" cellpadding="0" cellspacing="1">
						         <tr class="rowHead">
						           <td height="20" nowrap align="center" class="globalTextBold">任务名称</td>
						           <td height="20" nowrap align="center" class="globalTextBold">操作</td>
						         </tr>


						         <c:forEach var="job" items="${page.data}" varStatus="status">
						         		<c:set var="isCritical" value="false"></c:set>
							         	<c:forEach var="criticalJob" items="${criticalJobList}" varStatus="status">
							         		<c:if test="${job.id eq criticalJob.job.id}">
												<c:set var="isCritical" value="true"></c:set>
							         		</c:if>
							         	</c:forEach>

						         		<tr class="rowClass">
						         			<c:choose>
						         				<c:when test="${isCritical=='true'}">
						         					<td height="20" class="globalText" style="color: red;text-align: center;">
						         						<img align="absmiddle" title="重点任务" alt="重点任务" src="<c:url value='/images/status2.gif' />">
						         						<a onclick="viewDetail('${job.id}')" href="javascript:;">${job.name}</a>
						         					</td>
												    <td height="20" class="globalText">
												    	  <input jobName="${job.name}" jobId="${job.id}" type="button" class="btnStyle chooseBtn" style="display: none;" value="选择" >
												          <c:if test="${projectId==null}">
												           		<input type="button" class="btnStyle editBtn" value="编辑" onclick="javascript:window.location='<c:url value='/admin/jobEdit.html' />?jobId=${job.id}'" >
												          </c:if>
													</td>
						         				</c:when>
						         				<c:when test="${isCritical=='false'}">
						         					<td height="20" class="globalText">
						         						<a onclick="viewDetail('${job.id}')" href="javascript:;">${job.name}</a>
						         					</td>
												    <td height="20" class="globalText">
												    	<input jobName="${job.name}" jobId="${job.id}" type="button" class="btnStyle chooseBtn" style="display: none;" value="选择" >
												          <c:if test="${projectId==null}">
												           		<input type="button" class="btnStyle editBtn" value="编辑" onclick="javascript:window.location='<c:url value='/admin/jobEdit.html' />?jobId=${job.id}'" >
												           		<input type="button" class="btnStyle editBtn" value="删除" onclick="javascript:removeJob(${job.id})" >
												          </c:if>
													</td>
						         				</c:when>
						         			</c:choose>

										</tr>

						         </c:forEach>


						       </table>
						     </td>
						   </tr>

                        </table>

                        <%@ include file="/WEB-INF/jsp/includePagination.jsp"%>
<form target="tempFrame" method="post" id="removeJob" action="<c:url value='/admin/removeJob.html' />">
    <input type="hidden" id="jobId" name="jobId"/>
</form>
<script>
    $(document).ready(function(){
        invoke();
    });
    function removeJob(id) {
        if (confirm('删除［任务］并不影响使用该任务的［计划］\n删除后如果需要恢复，请联系系统管理员\n\n请确认是否删除任务？')) {
            $('#jobId').val(id);
            $('#removeJob').submit();
        }
    }

    function submitCallbackSuccess(obj){
        window.location="<c:url value='/admin/jobList.html' />";
    }
</script>
